import fetch from "@/utils/fetch"
import {formatDate1} from '@/utils/dateFomart.js'

let MserviceName = 'api/jp-HCZZ-AdminWeb-app-ms/';
export function getLinkTable(pagelist){
  //获取列表初始化数据
   //console.log(pagelist);
    return fetch({
        url: 'api/jp-BIRM-UserProfile-ms/'
            +'priFuncLink/page?pageNum='
            +pagelist.pageNum
            +"&pageSize="
            +pagelist.pageSize,
        method:'get',
    })
}

export function getLinkTableSearch(data){
     return fetch({
        url: MserviceName
            +'source/link/queryByName?name='
            +data.name
            +'&curPage='
            +data.page
            +'&pageSize='
            +data.pageSize,
        method:'get',
     })
 }

export function addLink(data){
   //console.log('新增链接请求');
    return fetch({
      url: MserviceName
          +'source/link/add'
          +'?url='
          +data.url
          +'&name='
          +data.name
          +'&createUserId='
          +data.createUserId,
      method:'get'
    })
}
    
export function editLink(data){
    //http://172.17.99.30:10014/api/jp-HCZZ-AdminWeb-app-ms/source/link/update?id=
    //a061fd18-8ffb-4961-a208-bb4cdc6fcc5a&url=123&name=123&updateUserId=zhoupeng
    //console.log('修改链接');
     return fetch({
         url: MserviceName
             +'/source/link/update?id='
             +data.id
             +"&name="
             +data.name
             +"&url="
             +data.url
             +"&updateUserId="
             +data.updateUserId,
         method:'get',
     })
 }

 export function deletLink(ids){
    //console.log('删除链接:http://172.17.99.30:10014/api/jp-HCZZ-AdminWeb-app-ms/source/link/delete');
     return fetch({
         url:  MserviceName
              +'source/link/delete',
         data: ids,
         method:'post'
     })
 }



